Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ccip-4308 Test logic optimizations for docker node tests #15392

Closed
wants to merge 13 commits into from

Conversation

AnieeG
Copy link
Contributor

@AnieeG AnieeG commented Nov 22, 2024

Requires

Supports

  • Updates funding logic so that if there are more than 1 private keys provided, the funding of CL nodes will be done in parallel from the last key while the contract deployment will continue with deployer key as the first key
  • Made MCMS contract deployment parallel across chains
  • Updated USDC set up to perform contract write operations across chains parallel
  • Updated USDC tests to send all requests first and then wait for delivery for all of them in parallel

@AnieeG AnieeG requested review from a team as code owners November 22, 2024 21:21
Comment on lines -318 to +320
e.Logger.Info("ccip multicall already deployed", "addr", mc3.Address)
if mc3 != nil {
e.Logger.Info("ccip multicall already deployed", "addr", mc3.Address)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

Comment on lines +715 to +718
var srcToken *burn_mint_erc677.BurnMintERC677
var srcPool *burn_mint_token_pool.BurnMintTokenPool
var dstToken *burn_mint_erc677.BurnMintERC677
var dstPool *burn_mint_token_pool.BurnMintTokenPool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit/ can combine into one var decl

@@ -130,7 +134,20 @@ func NewLocalDevEnvironment(

// fund the nodes
zeroLogLggr := logging.GetTestLogger(t)
FundNodes(t, zeroLogLggr, testEnv, cfg, don.PluginNodes())
// check if we can fund in parallel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When wouldn't we want to fund in parallel? Real testnets?

@@ -437,6 +455,12 @@ func CreateDockerEnv(t *testing.T) (
evmNetworks[i].URLs = rpcProvider.PrivateWsUrsl()
}
env.EVMNetworks = append(env.EVMNetworks, &evmNetworks[i])
// if number of private keys is more than 1, we can fund the nodes in parallel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, is this logic really required? Why not just always fund in parallel? Can't imagine it'd add that much overhead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean change it to having >2 keys in private keys always and fail otherwise?

@@ -173,28 +178,41 @@ func TestUSDCTokenTransfer(t *testing.T) {
},
}

for i, tt := range tcs {
tcs[i].initialBalances = make(map[common.Address]*big.Int)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this doesn't seem right. Every test can pick any token / any chain to transfer. Therefore any sequential test relies on the outcome of the previous one. For instance, if test1 sends a token from A -> B, and test2 does a similar work, you will get the wrong initial balance for test2, because in the meantime that balance will be changed by test1 execution.

If it doesn't fails then probably it's mainly because we pick different combinations for every test case. However, adding new test case will probably break it, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every test is using a different receiver right? will that not make it separate from each other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants